<?php

$pluginName = 'image';
class metadataPlugins_image extends BaseMetadata
{
	public function saveMeta()
	{
		$type = $this->file->getType();
		if($gis = getimagesize($this->file->getURI()))
		{
			$this->addMetadata($gis[0].'x'.$gis[1], $type);
			// landscape and portrait 
			if($gis[0] >= $gis[1])
			{
				$this->addMetadata('landscape', $type);
			}
			else
			{
				$this->addMetadata('portrait', $type);
			}

		}
		return parent::saveMeta();
	}
	
	public static function getPluginName()
	{
		return 'image';
	}
	
	public static function getPluginDescription()
	{
		return 'metadata from images files';
	}
	
	public static function getMimeHandle()
	{
		return array(
			'image/bmp',
			'image/gif',
			'image/jpeg',
			'image/png',
			'image/tiff');
	}
	
}
